package com.wiscamp.ninechapters.problems.application.dto.vo.problems;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.wiscamp.ninechapters.ddd.ViewObject;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collection;

@Data
public class ProblemVO implements ViewObject {

    /**
     * 题编号
     */
    private long problemId;

    /**
     * 题类型编号
     */
    private long problemTypeId;

    /**
     * 题分数
     */
    private double problemScore = 0;

    /**
     * 答题时限
     */
    private int timeLimit = 0;

    /**
     * 难度值
     */
    private int difficulty = 0;

    /**
     * 备注
     */
    private String remark = "";

    /**
     * 隶属题集编号
     */
    private long collectionId = 0;

    /**
     * 部分编号
     */
    private long partId = 0;

    /**
     * 节编号
     */
    private long sectionId = 0;

    /**
     * 隶属题集序号
     */
    private int problemIndex = 0;

    /**
     * 是否可用
     */
    private boolean enabled = true;

    /**
     * 创建用户
     */
    private long creatorId = 0;

    /**
     * 创建时间
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime creationTime;

    /**
     * 编辑用户
     */
    private long modifierId = 0;

    /**
     * 编辑时间
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime modificationTime;

    /**
     * 问题模式名称
     */
    private String questionModeName = "";

    /**
     * 是否有题干
     */
    private boolean hasStem = false;

    /**
     * 题干编号
     */
    private long stemId = 0;

    private StemVO stem;

    /**
     * 是否有多个问题
     */
    boolean hasMultipleQuestions = false;

    /**
     * 问题列表
     */
    public Collection<QuestionVO> questions = new ArrayList<>();

    /**
     * 题主要知识点列表
     */
    private Collection<ProblemKnowledgePointVO> primaryKnowledgePoints = new ArrayList<>();

    /**
     * 题次要知识点列表
     */
    private Collection<ProblemKnowledgePointVO> minorKnowledgePoints = new ArrayList<>();

    /**
     * 题标签列表
     */
    private Collection<TagNameVO> tagNames = new ArrayList<>();
}
